<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Результаты поиска официантов</title>
</head>
<body>
	
	<%	if(request.getAttribute("waiters") == null) { %>
		<p>Поиск не дал результатов </p>
			
	<%  }
		else { %>
			<p>Результат поиска по запросу</p> 
			
			<table border="1">
             <tr>
                 <th>ID</th>                
                 <th>Имя</th>
                 <th>Фамилия</th>
                 <th>Отчество</th>                
                 <th>Зарплата</th>
             </tr>
             <c:forEach var="waiter" items="${waiters}"> 
                 <tr>
                     <td>${waiter.id}</td> 
                     <td>${waiter.firstName}</td>
                     <td>${waiter.lastName}</td>
                     <td>${waiter.patronymicName}</td> 
                     <td>${waiter.salary}</td>                      
                     <td border="0">
	                      <form action="editWaiter" name="editWaiter" method="post">
	                      	<input type="hidden" name="id" value="${waiter.id}"/>
				        	<input type="submit" value="Редактировать"/>
				          </form>
			         </td> 
			         <td border="0">
	                      <form action="removeWaiter" name="removeWaiter" method="post">
	                      	<input type="hidden" name="id" value="${waiter.id}"/>
				        	<input type="submit" value="Удалить"/>
				         </form>
			         </td>
                 </tr> 
             </c:forEach>
         </table>   
			
	<%  	}
	%>
	
</body>
</html>